Skip to content

Move subscription info fetch into Go#334

Merged
Goooler merged 4 commits into
trunkfrom
fetch-sub-info-in-go
Jun 14, 2026
Merged

Move subscription info fetch into Go#334
Goooler merged 4 commits into
trunkfrom
fetch-sub-info-in-go

Conversation

@Goooler

@Goooler Goooler commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Moves the subscription information fetching and parsing from Kotlin/JVM into the Go native layer to reduce redundant network requests, reuse Go-level network stack, and reduce dependency/APK size.

Ports MetaCubeX@8a0e818.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves subscription metadata retrieval (e.g., subscription-userinfo and profile-update-interval headers) from the Android/Kotlin service layer into the Go native fetch pipeline, so subscription parsing happens alongside the existing Go-based profile fetch and validation.

Changes:

  • Added a new FetchStatus.Action.SubscriptionInfo event and extra fields on FetchStatus to carry subscription stats and server-provided update interval.
  • Updated profile import/update flows to consume the Go-reported subscription info instead of making a separate OkHttp request.
  • Removed the service module’s OkHttp dependency and deleted the Kotlin-side subscription header fetch/parser utility.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/profile/src/androidMain/kotlin/com/github/kr328/clash/profile/vm/PropertiesViewModel.kt Ignores SubscriptionInfo in the progress UI so progress text/state isn’t disturbed by the new status event.
service/src/main/kotlin/com/github/kr328/clash/service/util/SubscriptionUserInfo.kt Removes Kotlin/OkHttp-based subscription header fetching and parsing.
service/src/main/kotlin/com/github/kr328/clash/service/ProfileProcessor.kt Captures SubscriptionInfo from Clash.fetchAndValid and persists subscription fields/update interval when importing/updating profiles.
service/src/main/kotlin/com/github/kr328/clash/service/ProfileManager.kt Drops the additional “updateFlow” subscription refresh that previously performed a separate request.
service/build.gradle.kts Removes OkHttp dependencies from the service module.
core/src/main/kotlin/com/github/kr328/clash/core/model/FetchStatus.kt Extends FetchStatus with subscription fields and a new SubscriptionInfo action.
core/src/main/golang/native/config/fetch.go Extracts subscription headers during config fetch and reports them back to Kotlin via a new SubscriptionInfo status payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/src/main/golang/native/config/fetch.go
@Goooler Goooler enabled auto-merge (squash) June 14, 2026 10:44
@Goooler Goooler merged commit 6c0bc8e into trunk Jun 14, 2026
5 checks passed
@Goooler Goooler deleted the fetch-sub-info-in-go branch June 14, 2026 10:51
@Goooler Goooler mentioned this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants